﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.DialogUI {
    import flash.events.*;
    import Engine.Managers.*;
    import flash.display.*;
    import Events.*;
    import flash.utils.*;
    import org.aswing.*;
    import Classes.*;
    import Classes.util.*;
    import Display.*;
    import Classes.virals.*;
    import flash.text.*;
    import org.aswing.event.*;
    import org.aswing.border.*;
    import Display.aswingui.*;
    import Modules.stats.types.*;
    import L10n.*;
    import com.zynga.skelly.util.*;

    public class GenericDialogView extends JPanel {

        public static const TYPE_NONE:int = -1;
        public static const TYPE_OK:int = 0;
        public static const TYPE_ACCEPTCANCEL:int = 1;
        public static const TYPE_YESNO:int = 2;
        public static const TYPE_MODAL:int = 3;
        public static const TYPE_SAVESHARESAVE:int = 4;
        public static const TYPE_SHARECANCEL:int = 5;
        public static const TYPE_SENDGIFTS:int = 6;
        public static const TYPE_CONFIRM:int = 7;
        public static const TYPE_NOBUTTONS:int = 8;
        public static const TYPE_VISIT:int = 9;
        public static const TYPE_ADDNEIGHBOR:int = 10;
        public static const TYPE_ASKFRIEND:int = 11;
        public static const TYPE_ASKFRIENDS_BUYPERMITS:int = 12;
        public static const TYPE_SAVE:int = 13;
        public static const TYPE_TITLENOCLOSE:int = 14;
        public static const TYPE_SAVESHARECOINS:int = 15;
        public static const TYPE_GETCASH:int = 16;
        public static const TYPE_SHARECOINS:int = 17;
        public static const TYPE_REMOVECANCEL:int = 18;
        public static const TYPE_PLAY:int = 19;
        public static const TYPE_INVITEFRIENDS_BUYNEIGHBORS:int = 19;
        public static const TYPE_INVITEFRIENDS_BUYFRANCHISEUNLOCKS:int = 20;
        public static const TYPE_CUSTOM_OK:int = 21;
        public static const TYPE_YESNO_SHARE:int = 22;
        public static const TYPE_GETCASH_SHARE:int = 23;
        public static const YES:int = 1;
        public static const CANCEL:int = 0;
        public static const NO:int = 0;
        public static const SKIP:int = 2;
        public static const YES_NOMARKET:int = 3;
        public static const SHARE:int = 4;
        public static const ICON_POS_LEFT:int = 0;
        public static const ICON_POS_RIGHT:int = 1;
        public static const ICON_POS_TOP:int = 2;
        public static const ICON_POS_BOTTOM:int = 3;
        public static const BUTTON_MARGIN:int = 20;

        protected const character_width:int = 109;
        protected const character_height:int = 191;

        protected var m_titleFontSize:Number = 20;
        protected var m_titleSmallCapsFontSize:Number = 30;
        protected var m_message:String;
        protected var m_titleString:String;
        protected var m_type:int;
        protected var m_acceptTextName:String = "Accept";
        protected var m_cancelTextName:String = "Cancel";
        protected var m_skipTextName:String = "Skip";
        protected var m_shareTextName:String = "Share";
        protected var m_closeCallback:Function;
        protected var m_skipCallback:Function;
        protected var m_bgAsset:DisplayObject;
        protected var m_bgInterior:DisplayObject;
        protected var m_closeBtn:DisplayObject;
        protected var m_keystone:DisplayObject;
        protected var m_assetDict:Dictionary;
        protected var m_titlePanel:JPanel;
        protected var m_interiorHolder:JPanel;
        protected var m_textArea:JPanel;
        protected var m_align:String;
        protected var m_title:JTextField;
        protected var m_icon:String;
        protected var m_iconPos:int;
        protected var m_messagePaddingLeft:Number = 35;
        protected var m_messagePaddingRight:Number = 50;
        protected var m_customOk:String;
        protected var m_relativeIcon:Boolean = true;
        protected var m_feedShareViralType:String = "";
        protected var m_doStatsTrackingFunction:Function = null;
        protected var m_getStatsTitleFunction:Function = null;
        private var m_textComponent:Component;

        public function GenericDialogView(_arg1:Dictionary, _arg2:String="", _arg3:String="", _arg4:int=0, _arg5:Function=null, _arg6:String="", _arg7:int=0, _arg8:String="", _arg9:Function=null, _arg10:String="", _arg11:Boolean=true){
            super(new SoftBoxLayout(SoftBoxLayout.X_AXIS, 0, SoftBoxLayout.TOP));
            this.m_icon = _arg6;
            this.m_iconPos = _arg7;
            this.m_assetDict = _arg1;
            this.m_type = _arg4;
            this.m_customOk = _arg10;
            this.m_relativeIcon = _arg11;
            if (_arg5 != null){
                this.m_closeCallback = _arg5;
            };
            if (_arg9 != null){
                this.m_skipCallback = _arg9;
            };
            this.m_titleString = _arg3;
            this.m_message = _arg2;
            this.m_feedShareViralType = _arg8;
            this.m_align = ((this.m_type)==TYPE_ASKFRIEND) ? TextFormatAlign.LEFT : TextFormatAlign.CENTER;
            this.init();
        }
        protected function init():void{
            switch (this.m_type){
                case TYPE_OK:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "OkButton");
                    break;
                case TYPE_CUSTOM_OK:
                    this.m_acceptTextName = this.m_customOk;
                    break;
                case TYPE_YESNO:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "Yes");
                    this.m_cancelTextName = ZLoc.t("Dialogs", "No");
                    break;
                case TYPE_ACCEPTCANCEL:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "Accept");
                    this.m_cancelTextName = ZLoc.t("Dialogs", "Cancel");
                    break;
                case TYPE_SAVESHARESAVE:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "SaveShare");
                    this.m_cancelTextName = ZLoc.t("Dialogs", "Save");
                    break;
                case TYPE_SHARECANCEL:
                    if (this.m_feedShareViralType == ""){
                        this.m_acceptTextName = ZLoc.t("Dialogs", "Share");
                    } else {
                        this.m_acceptTextName = Viral.getViralHelperRewardText(this.m_feedShareViralType);
                    };
                    this.m_cancelTextName = ZLoc.t("Dialogs", "Cancel");
                    break;
                case TYPE_SENDGIFTS:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "SendGifts");
                    this.m_cancelTextName = ZLoc.t("Dialogs", "Skip");
                    break;
                case TYPE_CONFIRM:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "Confirm");
                    break;
                case TYPE_VISIT:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "Visit");
                    break;
                case TYPE_ADDNEIGHBOR:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "Expand");
                    break;
                case TYPE_ASKFRIEND:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "AskFriends");
                    break;
                case TYPE_ASKFRIENDS_BUYPERMITS:
                    this.m_cancelTextName = ZLoc.t("Dialogs", "PermitDialog_ask");
                    break;
                case TYPE_INVITEFRIENDS_BUYNEIGHBORS:
                    this.m_cancelTextName = ZLoc.t("Dialogs", "NeighborBuyDialog_ask");
                    break;
                case TYPE_SAVE:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "Save");
                    break;
                case TYPE_SAVESHARECOINS:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "SaveShareCoins");
                    this.m_cancelTextName = ZLoc.t("Dialogs", "Save");
                    break;
                case TYPE_GETCASH:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "GetCash");
                    break;
                case TYPE_SHARECOINS:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "ShareCoins");
                    break;
                case TYPE_REMOVECANCEL:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "Remove");
                    this.m_cancelTextName = ZLoc.t("Dialogs", "Cancel");
                    break;
                case TYPE_PLAY:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "PlayCityville");
                    break;
                case TYPE_YESNO_SHARE:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "Yes");
                    this.m_cancelTextName = ZLoc.t("Dialogs", "No");
                    this.m_shareTextName = ZLoc.t("Dialogs", "AskFriendsPermits");
                    break;
                case TYPE_GETCASH_SHARE:
                    this.m_acceptTextName = ZLoc.t("Dialogs", "GetCash");
                    this.m_shareTextName = ZLoc.t("Dialogs", "AskFriendsPermits");
                    break;
            };
            this.m_bgAsset = this.m_assetDict["dialog_bg"];
            this.m_closeBtn = this.m_assetDict["btn_closemc"];
            this.makeBackground();
            this.makeCenterPanel();
            ASwingHelper.prepare(this);
        }
        public function conditionalRebuildCenterPanel():void{
            this.remove(this.interiorHolder);
            this.makeCenterPanel();
        }
        public function get assetDict():Dictionary{
            return (this.m_assetDict);
        }
        protected function makeBackground():void{
            var _local1:MarginBackground;
            if (this.m_bgAsset){
                _local1 = new MarginBackground(this.m_bgAsset, new Insets(0, 0, 10, 0));
                this.setBackgroundDecorator(_local1);
            };
        }
        public function set titlePanel(_arg1:JPanel):void{
            this.m_titlePanel = _arg1;
        }
        public function get titlePanel():JPanel{
            return (this.m_titlePanel);
        }
        public function set title(_arg1:JTextField):void{
            this.m_title = _arg1;
        }
        public function get title():JTextField{
            return (this.m_title);
        }
        public function set interiorHolder(_arg1:JPanel):void{
            this.m_interiorHolder = _arg1;
        }
        public function get interiorHolder():JPanel{
            return (this.m_interiorHolder);
        }
        public function set textArea(_arg1:JPanel):void{
            this.m_textArea = _arg1;
        }
        public function get textArea():JPanel{
            return (this.m_textArea);
        }
        public function get acceptText():String{
            return (this.m_acceptTextName);
        }
        public function get cancelText():String{
            return (this.m_cancelTextName);
        }
        public function get skipText():String{
            return (this.m_skipTextName);
        }
        public function setStatsTrackingFunction(_arg1:Function, _arg2:Function):void{
            this.m_doStatsTrackingFunction = _arg1;
            this.m_getStatsTitleFunction = _arg2;
        }
        protected function makeCenterPanel():void{
            this.interiorHolder = this.createInteriorHolder();
            this.append(this.interiorHolder);
            ASwingHelper.prepare(this);
        }
        protected function createInteriorHolder():JPanel{
            var _local3:JPanel;
            var _local1:JPanel = new JPanel(new SoftBoxLayout(SoftBoxLayout.Y_AXIS, -10, AsWingConstants.CENTER));
            var _local2:JPanel = this.createHeaderPanel();
            ASwingHelper.prepare(_local2);
            this.textArea = this.createTextArea();
            ASwingHelper.prepare(this.textArea);
            _local1.setBorder(new EmptyBorder(null, new Insets(0, 0, 0, 0)));
            if (this.m_type != TYPE_NOBUTTONS){
                _local1.append(_local2);
            };
            _local1.append(ASwingHelper.verticalStrut(20));
            _local1.append(this.textArea);
            _local1.append(ASwingHelper.verticalStrut(BUTTON_MARGIN));
            if (((!((this.m_type == TYPE_MODAL))) && (!((this.m_type == TYPE_NOBUTTONS))))){
                _local3 = this.createButtonPanel();
                _local1.append(_local3);
            };
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        protected function createTitlePanel():JPanel{
            var _local2:String;
            var _local3:TextFormat;
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            this.m_titleFontSize = TextFieldUtil.getLocaleFontSize(this.m_titleSmallCapsFontSize, this.m_titleFontSize, null);
            if (this.m_titleString != ""){
                _local2 = ZLoc.t("Dialogs", (this.m_titleString + "_title"), this.getTitleTokens());
                this.title = ASwingHelper.makeTextField(_local2, EmbeddedArt.TITLE_FONT, this.m_titleFontSize, EmbeddedArt.titleColor, 3);
                this.title.filters = EmbeddedArt.newtitleFilters;
                _local3 = new TextFormat();
                _local3.size = this.m_titleSmallCapsFontSize;
                TextFieldUtil.formatSmallCaps(this.title.getTextField(), _local3);
                _local1.append(this.title);
                this.title.getTextField().height = (this.m_titleFontSize * 1.5);
            } else {
                _local1.append(ASwingHelper.verticalStrut(10));
            };
            ASwingHelper.setEasyBorder(_local1, 4);
            return (_local1);
        }
        protected function getTitleTokens():Object{
            return (null);
        }
        protected function createIconPane():JPanel{
            var iconPane:* = null;
            var iconString:* = null;
            var iconLoader:* = null;
            iconPane = new AssetPane();
            if (this.m_relativeIcon){
                iconString = Global.getAssetURL(this.m_icon);
            } else {
                iconString = this.m_icon;
            };
            iconLoader = LoadingManager.load(iconString, Curry.curry(function (_arg1:JPanel, _arg2:Event):void{
                iconPane.setAsset(iconLoader.content);
                ASwingHelper.prepare(_arg1);
                _arg1.dispatchEvent(new UIEvent(UIEvent.REFRESH_DIALOG, "iconLoaded", true));
            }, this));
            var iconInnerPane:* = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            iconInnerPane.append(iconPane);
            return (iconInnerPane);
        }
        protected function createTextArea():JPanel{
            var _local2:Number;
            var _local8:JPanel;
            var _local9:JPanel;
            var _local10:JPanel;
            var _local11:JPanel;
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER, 10);
            if (((!((this.m_icon == null))) && (!((this.m_icon == ""))))){
                _local2 = this.setMessageTextWidth((((this.m_iconPos == ICON_POS_LEFT)) || ((this.m_iconPos == ICON_POS_RIGHT))));
                _local8 = this.createIconPane();
            } else {
                _local2 = this.setMessageTextWidth(false);
            };
            var _local3:Component = this.createTextComponent(_local2);
            var _local4:JPanel = this.createTextAreaInnerPane(_local3);
            var _local5:JPanel = _local8;
            var _local6:JPanel = _local4;
            if ((((this.m_iconPos == ICON_POS_RIGHT)) || ((this.m_iconPos == ICON_POS_BOTTOM)))){
                _local5 = _local4;
                _local6 = _local8;
            };
            _local1.append(ASwingHelper.horizontalStrut(this.m_messagePaddingLeft));
            if ((((this.m_iconPos == ICON_POS_LEFT)) || ((this.m_iconPos == ICON_POS_RIGHT)))){
                if (_local5){
                    _local1.append(_local5);
                };
                if (_local6){
                    _local1.append(_local6);
                };
            } else {
                _local9 = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER, 10);
                ASwingHelper.setEasyBorder(_local9, 10);
                _local10 = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
                _local11 = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
                if (_local5){
                    _local10.append(_local5);
                    ASwingHelper.prepare(_local10);
                    _local9.append(_local10);
                };
                if (_local6){
                    _local11.append(_local6);
                    ASwingHelper.prepare(_local11);
                    _local9.append(_local11);
                };
                ASwingHelper.prepare(_local9);
                _local1.append(_local9);
            };
            _local1.append(ASwingHelper.horizontalStrut(this.m_messagePaddingRight));
            var _local7:int = _local3.getHeight();
            return (_local1);
        }
        protected function setMessageTextWidth(_arg1:Boolean=false):Number{
            var _local2:Number = 0;
            if (_arg1 == false){
                _local2 = 350;
            } else {
                _local2 = 285;
            };
            return (_local2);
        }
        protected function createTextComponent(_arg1:Number):Component{
            var _local2:Component;
            var _local4:Number;
            var _local5:Container;
            this.m_textComponent = ASwingHelper.makeMultilineText(this.m_message, (_arg1 - 10), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, this.m_align, 18, EmbeddedArt.brownTextColor);
            var _local3:Number = 75;
            if (this.m_textComponent.getHeight() < _local3){
                _local4 = ((_local3 - this.m_textComponent.getHeight()) / 2);
                _local5 = ASwingHelper.makeSoftBoxJPanelVertical();
                _local5.append(ASwingHelper.verticalStrut(_local4));
                LocaleHelper.localSetting.ASwingHelper_setEasyBorder(this.m_textComponent, 0, 16);
                LocaleHelper.localSetting.ASwingHelper_setPreferredHeight(this.m_textComponent, (this.m_textComponent.getHeight() * LocaleHelper.localSetting.genericMessageMargin));
                _local5.append(this.m_textComponent);
                _local5.append(ASwingHelper.verticalStrut(_local4));
                _local2 = _local5;
            } else {
                _local2 = this.m_textComponent;
            };
            return (_local2);
        }
        public function getMessageTextFiled():TextField{
            if (this.m_textComponent){
                return (((this.m_textComponent as AssetPane).getAsset() as TextField));
            };
            return (null);
        }
        protected function createTextAreaInnerPane(_arg1:Component):JPanel{
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            _local2.append(_arg1);
            return (_local2);
        }
        protected function createHeaderPanel():JPanel{
            var _local1:JPanel = new JPanel(new BorderLayout(1));
            var _local2:JPanel = this.createCloseButtonPanel();
            var _local3:JPanel = this.createTitlePanel();
            ASwingHelper.prepare(_local2);
            _local1.append(ASwingHelper.horizontalStrut(_local2.getWidth()), BorderLayout.WEST);
            _local1.append(_local3, BorderLayout.CENTER);
            _local1.append(_local2, BorderLayout.EAST);
            return (_local1);
        }
        protected function createHeaderInnerPanel():JPanel{
            var _local1:JPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
            var _local2:JPanel = this.createCloseButtonPanel();
            _local1.append(_local2);
            return (_local1);
        }
        protected function createCloseButtonPanel():JPanel{
            var _local2:JButton;
            var _local1:JPanel = new JPanel(ASwingHelper.softBoxLayoutVertical);
            if ((((((((((((((((((((((((((((((((((((this.m_type == TYPE_OK)) || ((this.m_type == TYPE_CUSTOM_OK)))) || ((this.m_type == TYPE_ACCEPTCANCEL)))) || ((this.m_type == TYPE_MODAL)))) || ((this.m_type == TYPE_SHARECANCEL)))) || ((this.m_type == TYPE_CONFIRM)))) || ((this.m_type == TYPE_ASKFRIENDS_BUYPERMITS)))) || ((this.m_type == TYPE_INVITEFRIENDS_BUYNEIGHBORS)))) || ((this.m_type == TYPE_VISIT)))) || ((this.m_type == TYPE_ADDNEIGHBOR)))) || ((this.m_type == TYPE_ASKFRIEND)))) || ((this.m_type == TYPE_NOBUTTONS)))) || ((this.m_type == TYPE_YESNO)))) || ((this.m_type == TYPE_YESNO_SHARE)))) || ((this.m_type == TYPE_GETCASH)))) || ((this.m_type == TYPE_GETCASH_SHARE)))) || ((this.m_type == TYPE_SHARECOINS)))) || ((this.m_type == TYPE_PLAY)))){
                _local2 = ASwingHelper.makeMarketCloseButton();
                _local2.addEventListener(MouseEvent.CLICK, this.onCancelX, false, 0, true);
                _local1.append(_local2);
                ASwingHelper.setEasyBorder(_local2, 3, 0, 0, 7);
            } else {
                _local1.append(ASwingHelper.verticalStrut(20));
            };
            return (_local1);
        }
        protected function createButtonPanel():JPanel{
            var _local3:CustomButton;
            var _local4:CustomButton;
            var _local5:CustomButton;
            var _local6:CustomButton;
            var _local1:JPanel = new JPanel(new FlowLayout(AsWingConstants.CENTER));
            this.m_cancelTextName.toUpperCase();
            if (this.m_type == TYPE_SAVESHARESAVE){
                _local3 = new CustomButton(this.m_cancelTextName, null, "GreyButtonUI");
                _local3.setPreferredWidth(100);
                _local3.setMinimumWidth(100);
                _local3.setMaximumWidth(100);
                _local3.addActionListener(this.onSkip, 0, true);
                _local1.append(_local3);
                _local1.append(ASwingHelper.horizontalStrut(5));
                this.m_acceptTextName = this.m_acceptTextName;
                this.m_skipTextName = this.m_acceptTextName;
            };
            if (((((((((((((((((((((((((((!((this.m_type == TYPE_SHARECANCEL))) && (!((this.m_type == TYPE_SAVESHARESAVE))))) && (!((this.m_type == TYPE_SAVE))))) && (!((this.m_type == TYPE_VISIT))))) && (!((this.m_type == TYPE_ADDNEIGHBOR))))) && (!((this.m_type == TYPE_ASKFRIEND))))) && (!((this.m_type == TYPE_INVITEFRIENDS_BUYNEIGHBORS))))) && (!((this.m_type == TYPE_ASKFRIENDS_BUYPERMITS))))) && (!((this.m_type == TYPE_OK))))) && (!((this.m_type == TYPE_CUSTOM_OK))))) && (!((this.m_type == TYPE_SHARECOINS))))) && (!((this.m_type == TYPE_GETCASH))))) && (!((this.m_type == TYPE_GETCASH_SHARE))))) && (!((this.m_type == TYPE_PLAY))))){
                _local4 = new CustomButton(this.m_cancelTextName, null, "RedButtonUI");
                _local4.addActionListener(this.onCancel, 0, true);
                _local1.append(_local4);
            };
            if ((((this.m_type == TYPE_ASKFRIENDS_BUYPERMITS)) || ((this.m_type == TYPE_INVITEFRIENDS_BUYNEIGHBORS)))){
                _local5 = new CustomButton(this.m_cancelTextName, null, "GreenButtonUI");
                _local5.addActionListener(this.onSkip, 0, true);
                this.m_skipTextName = this.m_cancelTextName;
                _local1.append(_local5);
            };
            this.m_acceptTextName.toUpperCase();
            var _local2:CustomButton = new CustomButton(this.m_acceptTextName, null, "GreenButtonUI");
            if (this.m_type == TYPE_SAVESHARESAVE){
                _local2.setPreferredWidth(225);
                _local2.setMinimumWidth(225);
                _local2.setMaximumWidth(225);
            };
            if (this.m_type == TYPE_SAVE){
                _local2.setPreferredWidth(175);
                _local2.setMinimumWidth(175);
                _local2.setMaximumWidth(175);
            };
            _local2.addActionListener(this.onAccept, 0, true);
            if (this.m_type == TYPE_ASKFRIENDS_BUYPERMITS){
                if (LocaleHelper.localSetting.sns.cash_enable){
                    _local1.append(_local2);
                };
            } else {
                _local1.append(_local2);
            };
            if ((((this.m_type == TYPE_YESNO_SHARE)) || ((this.m_type == TYPE_GETCASH_SHARE)))){
                _local6 = new CustomButton(this.m_shareTextName, null, "GreenButtonUI");
                _local6.addActionListener(this.onShare, 0, true);
                _local1.append(_local6);
            };
            return (_local1);
        }
        protected function onAccept(_arg1:AWEvent):void{
            dispatchEvent(new GenericPopupEvent(GenericPopupEvent.SELECTED, YES, true));
            this.close();
        }
        protected function onCancelX(_arg1):void{
            this.m_cancelTextName = "";
            this.countDialogViewAction("X");
            this.onCancel(_arg1);
        }
        protected function onCancel(_arg1):void{
            dispatchEvent(new GenericPopupEvent(GenericPopupEvent.SELECTED, NO, true));
            this.close();
        }
        protected function onSkip(_arg1):void{
            var _local2:GenericPopupEvent = new GenericPopupEvent(GenericPopupEvent.SELECTED, SKIP, true);
            dispatchEvent(_local2);
            this.close();
        }
        protected function onShare(_arg1):void{
            dispatchEvent(new GenericPopupEvent(GenericPopupEvent.SELECTED, SHARE, true));
            this.close();
        }
        public function close():void{
            if (this.m_skipCallback != null){
                removeEventListener(GenericPopupEvent.SELECTED, this.m_skipCallback);
            };
            this.closeMe();
        }
        protected function closeMe():void{
            dispatchEvent(new Event("close", true));
        }
        public function setAcceptTextName(_arg1:String):void{
            this.m_acceptTextName = _arg1;
        }
        public function setCancelTextName(_arg1:String):void{
            this.m_cancelTextName = _arg1;
        }
        public function countDialogViewAction(_arg1:String="view", _arg2:Boolean=true, _arg3:int=1):void{
            if ((((this.m_doStatsTrackingFunction == null)) || ((this.m_doStatsTrackingFunction == true)))){
                return;
            };
            var _local4:Boolean = this.m_doStatsTrackingFunction();
            if (!_local4){
                return;
            };
            var _local5:String = this.m_getStatsTitleFunction();
            var _local6:String = GameUtil.trimBadStatsCharacters(_arg1);
            StatsManager.sample(100, StatsKingdomType.DIALOG_STATS, _local5, _local6, "", "", "", _arg3);
            if (_arg2){
                this.m_acceptTextName = "";
                this.m_cancelTextName = "";
            };
        }

    }
}//package Display.DialogUI 
